/build-config : 创建镜像
router.post('/buildConfig',function(req,res,next){
	let method = "POST";
	let data = {
		name:"demo_test_4",
		space_name:"global",
		image_cache_enabled:true,
		auto_build_enabled:true,
		auto_tag_type:"TIME",
		build_image_enabled:true,
		code_repo:{
			code_repo_client:"SIMPLE_GIT",
			code_repo_path:"xxxxxxxxd.git",
			code_repo_type:"BRANCH",
			code_repo_type_value:"master",
			build_context_path:"/",
			dockerfile_location:"/"
		},
		customize_tag:"lastest",
		image_repo:{
			name:"satelliteview",
			registry:{
				name:"alauda_public_registry"
			}
		}
	};
	
	let urltemp = "http://18.1.103.19:20081/v1/private-build-configs/alauda/?namespace=alauda";
	let theurl = url.parse(urltemp);
	
	if(method == "POST"){
		let postData = data;
		let stringData = JSON.stringify(postData);
		let options = {
			hostname: theurl.hostname,
			port: theurl.port,
			path: theurl.path,
			method:"POST",
			headers:{
				"Authorization" : "token xxxxxxxxd",
				"Content-Type" : "appliction/json"
			}
		};
	};
	let theReq = http.request(options,function(theReq){
		
		console.log('状态码':${theReq.statusCode});
		console.log('响应头':&{JSON.stringify(theRes.headers)});
		theRes.setEncoding('utf8);
		theRes.on('data',(chunk)=>{
			console.log('响应主体':${chunk});
			respData + = chunk;
		});
		theRes.on('end',function(){
			console.log('响应中已无数据');
			console.log(respData);
			res.send(respData);
			
		})
		
	});
	theReq.on('error',function(e){
		console.error('请求遇到问题post:${e.messege}')
	});
	
	});
	theReq.write(stringData);
	theReq.end();
})

******************************************************************************************
/beginBuild : 开启镜像

data:{
	build_config_name : "demo_test_4",
	namespace:"alauda"
};

urltemp = "http://18.1.103.19.20081/v1/private-builds/alauda/?namespace=alauda";
******************************************************************************************

/createService: 创建服务

data:{
	service_name = "fancl-6",
	namespace:"alauda",
	region_name:"cluster0",
	custom_instance_size:{
		cpu:2,
		mem:4096
	},
	entrypoint:"",
	health_checks:[],
	image_name:"18.1.103.20:5000/autoci/sv-fancl",
	image_tag : "latest",
	instance_enwars:{},
	instance_size:"CUSTOMIZED",
	kube_config:{
		pod:{
			podAffinity:{},
			podAntiAffinity:{},
		}
	},
	
	load_balancers:[],
	namespace:"alauda",
	network_mode:"FLANNEL",
	pod_controller:"Deployment",
	ports:[8080],
	run_command:"",
	scaling_mode:"MANUAL",
	space_name:"global",
	target_num_instances:1,
	target_state:"STARTED",
	update_strategy:{
		max_surge:1,
		max_unavailable:1
	},
	version:"v2"
}

urltemp = "http://18.1.103.19.20081/v1/services/alauda/?namespace=alauda"


******************************************************************************************
/createPipeLine : 创建流水线

data ={
	artifact_enabled : true,
	name : "test-fancl - 3",
	namespace:"alauda",
	on_end:[],
	space_name:"global",
	
	stages:[{
		order:1,
		name:"first-stage",
		tasks:[{
			order:1,
			name:"task-1",
			type:"update-service"
			timeout:0,
			region:"cluster0",
			data:{
				env_files:[],
				env_vars:{},
				mount_points:[],
				service:{
					image_name : "18.1.103.20.5000/autoci/satelliteview",
					is_stateful:false,
					name:"sv1",
					type:"service"
				}
			}
		},
		{
			name:"task-2",
			order:2,
			timeout:0,
			type:"sync-registry",
			data:{
				config_name:"satelliteview",
				share_path:"/image/alauda/autoci/satelliteview"
			}
		}]
	}],
	triggers:{
		repository:{
			active:true,
			auto_trigger_enable:true,
			registry:"jncluster0",
			registry_display_name:"jncluster0",
			repository:"autoci/satelliteview",
			type:"repository"
		}
	}
};

url = "http://18.1.103.19:20081/v1/pipelines/alauda/config/?namespace=alauda"






























































